#ifndef X26_H
#define X26_H

#include "common.h"

template <AllegroVersion version>
struct x26
{
    uint32_t t;
    uint32_t k;
    
    uint32_t member_ptr;
    
    // Points to instance of `x22`, `x2C`, or `x33`.
    // Indicates the group that the member is a member of.
    uint32_t group_ptr;
    
    // Always null?
    uint32_t const_ptr;
    
    uint32_t TAIL;
    operator x26<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

#if __cplus >= 202002L
template <AllegroVersion version> requires(version >= A_172)
struct x26<version>
{
    uint32_t t;
    uint32_t k;

    uint32_t member_ptr;

    uint32_t un;

    // Points to instance of `x22`, `x2C`, or `x33`.
    // Indicates the group that the member is a member of.
    uint32_t group_ptr;

    // Always null?
    uint32_t const_ptr;

    COND_FIELD(version >= A_174, uint32_t, un1);

    uint32_t TAIL;
    operator x26<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#else
template <> struct x26<A_172>
{
    uint32_t t;
    uint32_t k;

    uint32_t member_ptr;

    uint32_t un;

    // Points to instance of `x22`, `x2C`, or `x33`.
    // Indicates the group that the member is a member of.
    uint32_t group_ptr;

    // Always null?
    uint32_t const_ptr;

    uint32_t TAIL;
    operator x26<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

template <> struct x26<A_174>
{
    uint32_t t;
    uint32_t k;

    uint32_t member_ptr;

    uint32_t un;

    // Points to instance of `x22`, `x2C`, or `x33`.
    // Indicates the group that the member is a member of.
    uint32_t group_ptr;

    // Always null?
    uint32_t const_ptr;

    uint32_t un1;

    uint32_t TAIL;
    operator x26<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#endif

#endif // X26_H
